Skip to content

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Sep 1, 2025

Fix some Ql4Ql violations based on the following checks

  • ql/field-only-used-in-charpred
  • ql/could-be-cast
  • ql/counting-to-zero
  • ql/dataflow-module-naming-convention
  • ql/if-with-none
  • ql/missing-parameter-qldoc
  • ql/misspelling

DCA looks good.

@github-actions github-actions bot added the Java label Sep 1, 2025
@michaelnebel michaelnebel added the no-change-note-required This PR does not need a change note label Sep 2, 2025
@michaelnebel michaelnebel marked this pull request as ready for review September 2, 2025 07:53
@michaelnebel michaelnebel requested review from a team as code owners September 2, 2025 07:53
@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 07:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes various Ql4Ql violations across Java CodeQL files, focusing on code quality improvements based on specific checks like field usage optimization, casting opportunities, parameter naming consistency, and documentation accuracy.

  • Updates code patterns to use more efficient constructs (e.g., not exists() instead of count() = 0)
  • Corrects spelling errors and improves parameter documentation consistency
  • Refactors conditional logic to eliminate unnecessary if-then-else patterns

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
java/ql/src/utils/flowtestcasegenerator/FlowTestCase.qll Updates parameter names in documentation comments for clarity
java/ql/src/experimental/quantum/Examples/BrokenCrypto.ql Fixes spelling from "MODELLING" to "MODELING"
java/ql/src/experimental/quantum/Analysis/ArtifactReuse.qll Simplifies exists pattern by removing unnecessary variable
java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverloading.ql Corrects parameter name in documentation
java/ql/src/Violations of Best Practice/Magic Constants/MagicConstants.qll Fixes spelling of "occurrence" in predicate names
java/ql/src/Likely Bugs/Termination/SpinOnField.ql Replaces count-based checks with more efficient exists patterns
java/ql/src/Likely Bugs/Concurrency/NotifyWithoutSynch.ql Adds missing parameter documentation
java/ql/src/Likely Bugs/Comparison/HashedButNoHash.ql Updates predicate documentation format
java/ql/lib/semmle/code/java/security/UnsafeDeserializationQuery.qll Corrects parameter name in documentation
java/ql/lib/semmle/code/java/security/TempDirUtils.qll Improves parameter documentation clarity
java/ql/lib/semmle/code/java/security/FileWritable.qll Fixes parameter name in documentation
java/ql/lib/semmle/code/java/security/CleartextStorageAndroidFilesystemQuery.qll Corrects parameter name in documentation
java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJB.qll Replaces count-based logic with exists patterns
java/ql/lib/semmle/code/java/frameworks/Mockito.qll Simplifies if-then-else logic and removes unnecessary field
java/ql/lib/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisSpecific.qll Adds missing parameter names in documentation
java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll Updates parameter names in location documentation
java/ql/lib/semmle/code/java/dataflow/internal/ContainerFlow.qll Enhances documentation with missing parameter details
java/ql/lib/semmle/code/java/Statement.qll Adds missing parameter names in documentation
java/ql/lib/semmle/code/java/Conversions.qll Removes unused field and moves logic into constructor
java/ql/lib/semmle/code/java/Concurrency.qll Adds missing parameter documentation
java/ql/lib/printAst.ql Adds missing parameter names in documentation
java/ql/lib/experimental/quantum/Language.qll Fixes spelling from "modelled" to "modeled"
java/ql/lib/experimental/quantum/JCA.qll Fixes spelling, removes unused fields, and simplifies expressions

Copy link
Contributor

@aschackmull aschackmull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One inline comment, otherwise LGTM.

@michaelnebel michaelnebel merged commit 2a932f0 into github:main Sep 2, 2025
17 checks passed
@michaelnebel michaelnebel deleted the java/ql4ql branch September 2, 2025 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants